package cn.common.springmvc;

import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry;

public class CustomPropertyEditorRegistrar implements PropertyEditorRegistrar {

	@Override
	public void registerCustomEditors(PropertyEditorRegistry registry) 
	{
		registry.registerCustomEditor(int.class, new CustomNumberEditorEx(Integer.class, true));
		registry.registerCustomEditor(byte.class, new CustomNumberEditorEx(Byte.class, false));
		registry.registerCustomEditor(short.class, new CustomNumberEditorEx(Short.class, false));
		registry.registerCustomEditor(int.class, new CustomNumberEditorEx(Integer.class, false));
		registry.registerCustomEditor(long.class, new CustomNumberEditorEx(Long.class, false));
		registry.registerCustomEditor(float.class, new CustomNumberEditorEx(Float.class, false));
		registry.registerCustomEditor(double.class, new CustomNumberEditorEx(Double.class, false));
	}

}
